# Python Documentation Turkish Translation # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-10-01 00:18+0000\n" "PO-Revision-Date: 2022-12-28 21:35+0300\n" "Last-Translator: \n" "Language-Team: TURKISH \n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 3.2.2\n" #: tutorial/controlflow.rst:5 msgid "More Control Flow Tools" msgstr "Daha Fazla Kontrol Akışı Aracı" #: tutorial/controlflow.rst:7 #, fuzzy msgid "" "As well as the :keyword:`while` statement just introduced, Python uses a few " "more that we will encounter in this chapter." msgstr "" "Az önce tanıtılan :keyword:`while` deyiminin yanı sıra Python, bazı " "değişikliklerle birlikte diğer dillerden bilinen olağan akış kontrol " "deyimlerini kullanır." #: tutorial/controlflow.rst:14 msgid ":keyword:`!if` Statements" msgstr ":keyword:`!if` İfadeleri" #: tutorial/controlflow.rst:16 msgid "" "Perhaps the most well-known statement type is the :keyword:`if` statement. " "For example::" msgstr "Belki de en iyi bilinen deyim türü :keyword:`if` deyimidir. Örneğin::" #: tutorial/controlflow.rst:33 msgid "" "There can be zero or more :keyword:`elif` parts, and the :keyword:`else` " "part is optional. The keyword ':keyword:`!elif`' is short for 'else if', " "and is useful to avoid excessive indentation. An :keyword:`!if` ... :" "keyword:`!elif` ... :keyword:`!elif` ... sequence is a substitute for the " "``switch`` or ``case`` statements found in other languages." msgstr "" "Sıfır veya daha fazla :keyword:`elif` bölümü olabilir ve :keyword:`else` " "bölümü isteğe bağlıdır. ':keyword:`!elif`' anahtar sözcüğü 'else if' " "ifadesinin kısaltmasıdır ve aşırı girintiden kaçınmak için kullanışlıdır. " "Bir :keyword:`!if` ... :keyword:`!elif` ... :keyword:`!elif` ... dizisi, " "diğer dillerde bulunan ``switch`` veya ``case`` deyimlerinin yerine geçer." #: tutorial/controlflow.rst:39 msgid "" "If you're comparing the same value to several constants, or checking for " "specific types or attributes, you may also find the :keyword:`!match` " "statement useful. For more details see :ref:`tut-match`." msgstr "" "Aynı değeri birkaç sabitle karşılaştırıyorsanız veya belirli türleri veya " "nitelikleri kontrol ediyorsanız, :keyword:`!match` deyimini de yararlı " "bulabilirsiniz. Daha fazla ayrıntı için :ref:`tut-match` bölümüne bakınız." #: tutorial/controlflow.rst:46 msgid ":keyword:`!for` Statements" msgstr ":keyword:`!for` İfadeleri" #: tutorial/controlflow.rst:51 msgid "" "The :keyword:`for` statement in Python differs a bit from what you may be " "used to in C or Pascal. Rather than always iterating over an arithmetic " "progression of numbers (like in Pascal), or giving the user the ability to " "define both the iteration step and halting condition (as C), Python's :" "keyword:`!for` statement iterates over the items of any sequence (a list or " "a string), in the order that they appear in the sequence. For example (no " "pun intended):" msgstr "" "Python'daki :keyword:`for` deyimi, C veya Pascal'da alışkın olduğunuzdan " "biraz farklıdır. Her zaman sayıların aritmetik ilerlemesi üzerinde yineleme " "yapmak (Pascal'daki gibi) veya kullanıcıya hem yineleme adımını hem de durma " "koşulunu tanımlama yeteneği vermek (C gibi) yerine, Python'un :keyword:`!" "for` deyimi, herhangi bir dizinin (bir liste veya bir dize) öğeleri " "üzerinde, dizide göründükleri sırayla yineler. Örneğin (kelime oyunu yapmak " "istemedim):" #: tutorial/controlflow.rst:72 msgid "" "Code that modifies a collection while iterating over that same collection " "can be tricky to get right. Instead, it is usually more straight-forward to " "loop over a copy of the collection or to create a new collection::" msgstr "" "Aynı koleksiyon üzerinde yineleme yaparken bir koleksiyonu değiştiren kodun " "doğru yazılması zor olabilir. Bunun yerine, koleksiyonun bir kopyası " "üzerinde döngü yapmak veya yeni bir koleksiyon oluşturmak genellikle daha " "kolaydır::" #: tutorial/controlflow.rst:94 msgid "The :func:`range` Function" msgstr ":func:`range` Fonksiyonu" #: tutorial/controlflow.rst:96 msgid "" "If you do need to iterate over a sequence of numbers, the built-in function :" "func:`range` comes in handy. It generates arithmetic progressions::" msgstr "" "Bir sayı dizisi üzerinde yineleme yapmanız gerekiyorsa, yerleşik :func:" "`range` fonksiyonu kullanışlı olur. Aritmetik ilerlemeler üretir::" #: tutorial/controlflow.rst:108 msgid "" "The given end point is never part of the generated sequence; ``range(10)`` " "generates 10 values, the legal indices for items of a sequence of length " "10. It is possible to let the range start at another number, or to specify " "a different increment (even negative; sometimes this is called the 'step')::" msgstr "" "Verilen bitiş noktası asla oluşturulan dizinin bir parçası değildir; " "``range(10)`` 10 değer üretir, 10 uzunluğundaki bir dizinin öğeleri için " "yasal indisler. Aralığın başka bir sayıdan başlamasına izin vermek veya " "farklı bir artış (negatif bile olsa; bazen buna 'adım' denir) belirtmek " "mümkündür::" #: tutorial/controlflow.rst:122 msgid "" "To iterate over the indices of a sequence, you can combine :func:`range` " "and :func:`len` as follows::" msgstr "" "Bir dizinin indisleri üzerinde yineleme yapmak için :func:`range` ve :func:" "`len` öğelerini aşağıdaki gibi birleştirebilirsiniz::" #: tutorial/controlflow.rst:135 msgid "" "In most such cases, however, it is convenient to use the :func:`enumerate` " "function, see :ref:`tut-loopidioms`." msgstr "" "Ancak bu tür durumların çoğunda :func:`enumerate` fonksiyonunu kullanmak " "uygundur, bkz :ref:`tut-loopidioms`." #: tutorial/controlflow.rst:138 msgid "A strange thing happens if you just print a range::" msgstr "Sadece bir aralık yazdırırsanız garip bir şey olur::" #: tutorial/controlflow.rst:143 msgid "" "In many ways the object returned by :func:`range` behaves as if it is a " "list, but in fact it isn't. It is an object which returns the successive " "items of the desired sequence when you iterate over it, but it doesn't " "really make the list, thus saving space." msgstr "" "Birçok yönden :func:`range` tarafından döndürülen nesne bir listeymiş gibi " "davranır, ancak aslında öyle değildir. Üzerinde yineleme yaptığınızda " "istenen dizinin ardışık öğelerini döndüren bir nesnedir, ancak listeyi " "gerçekten oluşturmaz, böylece yerden tasarruf sağlar." #: tutorial/controlflow.rst:148 msgid "" "We say such an object is :term:`iterable`, that is, suitable as a target for " "functions and constructs that expect something from which they can obtain " "successive items until the supply is exhausted. We have seen that the :" "keyword:`for` statement is such a construct, while an example of a function " "that takes an iterable is :func:`sum`::" msgstr "" "Böyle bir nesnenin :term:`iterable` olduğunu, yani arz tükenene kadar " "ardışık öğeler elde edebilecekleri bir şey bekleyen fonksiyonlar ve yapılar " "için bir hedef olarak uygun olduğunu söylüyoruz. Daha önce :keyword:`for` " "deyiminin böyle bir yapı olduğunu görmüştük, bir yinelenebilir alan bir " "fonksiyon örneği ise :func:`sum`::" #: tutorial/controlflow.rst:157 msgid "" "Later we will see more functions that return iterables and take iterables as " "arguments. In chapter :ref:`tut-structures`, we will discuss in more detail " "about :func:`list`." msgstr "" "Daha sonra yinelenebilirleri döndüren ve argüman olarak yinelenebilirleri " "alan daha fazla fonksiyon göreceğiz. :ref:`tut-structures` bölümünde, :func:" "`list` hakkında daha ayrıntılı olarak tartışacağız." #: tutorial/controlflow.rst:164 msgid "" ":keyword:`!break` and :keyword:`!continue` Statements, and :keyword:`!else` " "Clauses on Loops" msgstr "" ":keyword:`!break` ve :keyword:`!continue` İfadeleri ve :keyword:`!else` " "Döngülerdeki Cümleler" #: tutorial/controlflow.rst:166 #, fuzzy msgid "" "The :keyword:`break` statement breaks out of the innermost enclosing :" "keyword:`for` or :keyword:`while` loop." msgstr "" "C'de olduğu gibi :keyword:`break` deyimi, en içteki :keyword:`for` veya :" "keyword:`while` döngüsünü keser." #: tutorial/controlflow.rst:169 #, fuzzy msgid "" "A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` " "clause." msgstr "" ":keyword:`!break` ve :keyword:`!continue` İfadeleri ve :keyword:`!else` " "Döngülerdeki Cümleler" #: tutorial/controlflow.rst:171 msgid "" "In a :keyword:`for` loop, the :keyword:`!else` clause is executed after the " "loop reaches its final iteration." msgstr "" #: tutorial/controlflow.rst:174 msgid "" "In a :keyword:`while` loop, it's executed after the loop's condition becomes " "false." msgstr "" #: tutorial/controlflow.rst:176 msgid "" "In either kind of loop, the :keyword:`!else` clause is **not** executed if " "the loop was terminated by a :keyword:`break`." msgstr "" #: tutorial/controlflow.rst:179 msgid "" "This is exemplified in the following :keyword:`!for` loop, which searches " "for prime numbers::" msgstr "" #: tutorial/controlflow.rst:200 msgid "" "(Yes, this is the correct code. Look closely: the ``else`` clause belongs " "to the :keyword:`for` loop, **not** the :keyword:`if` statement.)" msgstr "" "(Evet, bu doğru koddur. Yakından bakın: ``else`` cümlesi :keyword:`for` " "döngüsüne aittir, **değil** :keyword:`if` deyimine)" #: tutorial/controlflow.rst:203 msgid "" "When used with a loop, the ``else`` clause has more in common with the " "``else`` clause of a :keyword:`try` statement than it does with that of :" "keyword:`if` statements: a :keyword:`try` statement's ``else`` clause runs " "when no exception occurs, and a loop's ``else`` clause runs when no " "``break`` occurs. For more on the :keyword:`!try` statement and exceptions, " "see :ref:`tut-handling`." msgstr "" "Bir döngü ile kullanıldığında, ``else`` ifadesinin :keyword:`try` deyiminin " "``else`` cümlesiyle, :keyword:`if` deyimlerininkinden daha fazla ortak " "noktası vardır: :keyword:`try` deyiminin ``else`` cümlesi herhangi bir " "istisna oluşmadığında çalışır ve bir döngünün ``else`` cümlesi herhangi bir " "``break`` oluşmadığında çalışır. :keyword:`!try` deyimi ve istisnalar " "hakkında daha fazla bilgi için :ref:`tut-handling` bölümüne bakınız." #: tutorial/controlflow.rst:210 msgid "" "The :keyword:`continue` statement, also borrowed from C, continues with the " "next iteration of the loop::" msgstr "" "Yine C'den ödünç alınan :keyword:`continue` deyimi, döngünün bir sonraki " "yinelemesiyle devam eder::" #: tutorial/controlflow.rst:231 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` İfadeleri" #: tutorial/controlflow.rst:233 msgid "" "The :keyword:`pass` statement does nothing. It can be used when a statement " "is required syntactically but the program requires no action. For example::" msgstr "" ":keyword:`pass` deyimi hiçbir şey yapmaz. Sözdizimsel olarak bir deyim " "gerektiğinde ancak program hiçbir eylem gerektirmediğinde kullanılabilir. " "Örneğin::" #: tutorial/controlflow.rst:240 msgid "This is commonly used for creating minimal classes::" msgstr "Bu genellikle minimal sınıflar oluşturmak için kullanılır::" #: tutorial/controlflow.rst:246 msgid "" "Another place :keyword:`pass` can be used is as a place-holder for a " "function or conditional body when you are working on new code, allowing you " "to keep thinking at a more abstract level. The :keyword:`!pass` is silently " "ignored::" msgstr "" ":keyword:`pass` 'in kullanılabileceği bir başka yer de, yeni kod üzerinde " "çalışırken bir fonksiyon veya koşul gövdesi için bir yer tutucu olarak daha " "soyut bir düzeyde düşünmeye devam etmenizi sağlamaktır. :keyword:`!pass` " "sessizce göz ardı edilir::" #: tutorial/controlflow.rst:258 msgid ":keyword:`!match` Statements" msgstr ":keyword:`!pass` İfadeleri" #: tutorial/controlflow.rst:260 msgid "" "A :keyword:`match` statement takes an expression and compares its value to " "successive patterns given as one or more case blocks. This is superficially " "similar to a switch statement in C, Java or JavaScript (and many other " "languages), but it's more similar to pattern matching in languages like Rust " "or Haskell. Only the first pattern that matches gets executed and it can " "also extract components (sequence elements or object attributes) from the " "value into variables." msgstr "" ":keyword:`match` bir ifadeyi alır ve değerini bir veya daha fazla case bloğu " "olarak verilen ardışık kalıplarla karşılaştırır. Bu, C, Java veya " "JavaScript'teki (ve diğer birçok dildeki) bir switch ifadesine yüzeysel " "olarak benzer, ancak Rust veya Haskell gibi dillerdeki kalıp eşleştirmeye " "daha çok benzer. Yalnızca eşleşen ilk kalıp yürütülür ve ayrıca bileşenleri " "(sıra öğeleri veya nesne nitelikleri) değerden değişkenlere çıkarabilir." #: tutorial/controlflow.rst:268 msgid "" "The simplest form compares a subject value against one or more literals::" msgstr "" "En basit form, bir konu değerini bir veya daha fazla sabitle karşılaştırır::" #: tutorial/controlflow.rst:281 msgid "" "Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " "never fails to match. If no case matches, none of the branches is executed." msgstr "" "Son bloğa dikkat edin: \"değişken adı\" ``_`` bir *wildcard* görevi görür ve " "asla eşleşmez. Hiçbir durum eşleşmezse, dallardan hiçbiri yürütülmez." #: tutorial/controlflow.rst:284 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "" "``|`` (\"or\") kullanarak birkaç sabiti tek bir kalıpta " "birleştirebilirsiniz::" #: tutorial/controlflow.rst:289 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" msgstr "" "Kalıplar paket açma atamaları gibi görünebilir ve değişkenleri bağlamak için " "kullanılabilir::" #: tutorial/controlflow.rst:305 msgid "" "Study that one carefully! The first pattern has two literals, and can be " "thought of as an extension of the literal pattern shown above. But the next " "two patterns combine a literal and a variable, and the variable *binds* a " "value from the subject (``point``). The fourth pattern captures two values, " "which makes it conceptually similar to the unpacking assignment ``(x, y) = " "point``." msgstr "" "Bunu dikkatle inceleyin! İlk kalıpta iki sabit vardır ve yukarıda " "gösterilen sabit kalıbının bir uzantısı olarak düşünülebilir. Ancak sonraki " "iki kalıp bir sabit ve bir değişkeni birleştirir ve değişken özneden " "(``point``) bir değer *bağlar*. Dördüncü kalıp iki değeri yakalar, bu da " "onu kavramsal olarak ``(x, y) = point`` paket açma atamasına benzer hale " "getirir." #: tutorial/controlflow.rst:312 msgid "" "If you are using classes to structure your data you can use the class name " "followed by an argument list resembling a constructor, but with the ability " "to capture attributes into variables::" msgstr "" "Verilerinizi yapılandırmak için sınıfları kullanıyorsanız, sınıf adını ve " "ardından bir yapıcıya benzeyen, ancak nitelikleri değişkenlere yakalama " "yeteneğine sahip bir argüman listesi kullanabilirsiniz::" #: tutorial/controlflow.rst:334 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " "specific position for attributes in patterns by setting the " "``__match_args__`` special attribute in your classes. If it's set to (\"x\", " "\"y\"), the following patterns are all equivalent (and all bind the ``y`` " "attribute to the ``var`` variable)::" msgstr "" "Konumsal parametreleri, nitelikleri için bir sıralama sağlayan bazı yerleşik " "sınıflarla (örneğin veri sınıfları) kullanabilirsiniz. Ayrıca sınıflarınızda " "``__match_args__`` niteliğini ayarlayarak kalıplardaki nitelikler için " "belirli bir konum tanımlayabilirsiniz. Bu özellik (\"x\", \"y\") olarak " "ayarlanırsa, bahsi geçen kalıpların hepsi eş değerdir (ve hepsi ``y`` " "niteliğini ``var`` değişkenine bağlar)::" #: tutorial/controlflow.rst:345 msgid "" "A recommended way to read patterns is to look at them as an extended form of " "what you would put on the left of an assignment, to understand which " "variables would be set to what. Only the standalone names (like ``var`` " "above) are assigned to by a match statement. Dotted names (like ``foo." "bar``), attribute names (the ``x=`` and ``y=`` above) or class names " "(recognized by the \"(...)\" next to them like ``Point`` above) are never " "assigned to." msgstr "" "Kalıpları okumak için önerilen bir yol, hangi değişkenlerin neye " "ayarlanacağını anlamak için onlara bir atamanın soluna koyacağınız şeyin " "genişletilmiş bir biçimi olarak bakmaktır. Yalnızca bağımsız isimler " "(yukarıdaki ``var`` gibi) bir eşleştirme deyimi tarafından atanır. Noktalı " "isimlere (``foo.bar`` gibi), nitelik isimlerine (yukarıdaki ``x=`` ve ``y=`` " "gibi) veya sınıf isimlerine (yukarıdaki ``Point`` gibi yanlarındaki " "\"(...)\" ile tanınan) asla atama yapılmaz." #: tutorial/controlflow.rst:352 #, fuzzy msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "Points, with ``__match_args__`` added, we could match it like this::" msgstr "" "Kalıplar keyfi olarak iç içe geçebilir. Örneğin, kısa bir nokta listemiz " "varsa, bunu şu şekilde eşleştirebiliriz::" #: tutorial/controlflow.rst:373 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " "value capture happens before the guard is evaluated::" msgstr "" "Bir kalıba \"guard\" olarak bilinen bir ``if`` cümlesi ekleyebiliriz. Eğer " "guard yanlış ise, ``match`` bir sonraki case bloğunu denemeye devam eder. " "Değer yakalamanın koruma değerlendirilmeden önce gerçekleştiğine dikkat " "edin::" #: tutorial/controlflow.rst:383 msgid "Several other key features of this statement:" msgstr "Bu açıklamanın diğer bazı kilit özellikleri:" #: tutorial/controlflow.rst:385 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " "that they don't match iterators or strings." msgstr "" "Paket açma atamaları gibi, tuple ve liste kalıpları da tamamen aynı anlama " "sahiptir ve aslında rastgele dizilerle eşleşir. Önemli bir istisna, " "yineleyicilerle veya string'lerle eşleşmezler." #: tutorial/controlflow.rst:389 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " "also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two items " "without binding the remaining items." msgstr "" "Sıra kalıpları genişletilmiş paket açmayı destekler: ``[x, y, *rest]`` ve " "``(x, y, *rest)`` paket açma atamalarına benzer şekilde çalışır. ``*`` " "öğesinden sonraki ad ``_`` de olabilir, bu nedenle ``(x, y, *_)`` öğesi, " "kalan öğeleri bağlamadan en az iki öğeden oluşan bir diziyle eşleşir." #: tutorial/controlflow.rst:394 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " "sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is " "also supported. (But ``**_`` would be redundant, so it is not allowed.)" msgstr "" "Eşleme kalıpları: ``{\"bandwidth\": b, \"latency\": l}`` bir sözlükten " "``\"bandwidth\"`` ve ``\"latency\"`` değerlerini yakalar. Sıra kalıplarının " "aksine, ekstra anahtarlar göz ardı edilir. ``**rest`` gibi bir paket açma " "da desteklenir. (Ancak ``**_`` gereksiz olacağından buna izin verilmez)" #: tutorial/controlflow.rst:399 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "Alt kalıplar ``as`` anahtar sözcüğü kullanılarak yakalanabilir::" #: tutorial/controlflow.rst:403 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" msgstr "" "girdinin ikinci elemanını ``p2`` olarak yakalayacaktır (girdi iki noktadan " "oluşan bir dizi olduğu sürece)" #: tutorial/controlflow.rst:406 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." msgstr "" "Çoğu sabit eşitlikle karşılaştırılır, ancak ``True``, ``False`` ve ``None`` " "tekilleri özdeşlikle karşılaştırılır." #: tutorial/controlflow.rst:409 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" msgstr "" "Kalıplar adlandırılmış sabitler kullanabilir. Bunlar, yakalama değişkeni " "olarak yorumlanmalarını önlemek için noktalı isimler olmalıdır::" #: tutorial/controlflow.rst:428 msgid "" "For a more detailed explanation and additional examples, you can look into :" "pep:`636` which is written in a tutorial format." msgstr "" "Daha ayrıntılı bir açıklama ve ek örnekler için, öğretici bir formatta " "yazılmış olan :pep:`636` sayfasına bakabilirsiniz." #: tutorial/controlflow.rst:434 msgid "Defining Functions" msgstr "Fonksiyonların Tanımlanması" #: tutorial/controlflow.rst:436 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" msgstr "" "Fibonacci serisini rastgele bir sınıra kadar yazan bir fonksiyon " "oluşturabiliriz::" #: tutorial/controlflow.rst:456 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " "parameters. The statements that form the body of the function start at the " "next line, and must be indented." msgstr "" "Anahtar kelime :keyword:`def` bir fonksiyon *tanımını* tanıtır. Bunu " "fonksiyon adı ve parantez içine alınmış resmi parametreler listesi takip " "etmelidir. Fonksiyonun gövdesini oluşturan ifadeler bir sonraki satırdan " "başlar ve girintili olmalıdır." #: tutorial/controlflow.rst:461 msgid "" "The first statement of the function body can optionally be a string literal; " "this string literal is the function's documentation string, or :dfn:" "`docstring`. (More about docstrings can be found in the section :ref:`tut-" "docstrings`.) There are tools which use docstrings to automatically produce " "online or printed documentation, or to let the user interactively browse " "through code; it's good practice to include docstrings in code that you " "write, so make a habit of it." msgstr "" "Fonksiyon gövdesinin ilk ifadesi isteğe bağlı olarak bir string literal " "olabilir; bu string literal fonksiyonun dokümantasyon stringi veya :dfn:" "`docstring` 'dir. (Docstringler hakkında daha fazla bilgi :ref:`tut-" "docstrings` bölümünde bulunabilir.) Otomatik olarak çevrimiçi veya basılı " "dokümantasyon üretmek veya kullanıcının etkileşimli olarak kodda gezinmesini " "sağlamak için docstringleri kullanan araçlar vardır; yazdığınız koda " "docstringler eklemek iyi bir uygulamadır, bu yüzden bunu alışkanlık haline " "getirin." #: tutorial/controlflow.rst:468 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " "in a function store the value in the local symbol table; whereas variable " "references first look in the local symbol table, then in the local symbol " "tables of enclosing functions, then in the global symbol table, and finally " "in the table of built-in names. Thus, global variables and variables of " "enclosing functions cannot be directly assigned a value within a function " "(unless, for global variables, named in a :keyword:`global` statement, or, " "for variables of enclosing functions, named in a :keyword:`nonlocal` " "statement), although they may be referenced." msgstr "" "Bir fonksiyonun *çalıştırılması*, fonksiyonun yerel değişkenleri için " "kullanılan yeni bir sembol tablosu ortaya çıkarır. Daha açık bir ifadeyle, " "bir fonksiyon içindeki tüm değişken atamaları değeri yerel sembol tablosunda " "saklar; oysa değişken referansları önce yerel sembol tablosuna, sonra " "çevreleyen fonksiyonların yerel sembol tablolarına, daha sonra global sembol " "tablosuna ve son olarak da yerleşik isimler tablosuna bakar. Bu nedenle, " "global değişkenlere ve çevreleyen fonksiyonların değişkenlerine bir " "fonksiyon içinde doğrudan değer atanamaz (global değişkenler için bir :" "keyword:`global` deyiminde veya çevreleyen fonksiyonların değişkenleri için " "bir :keyword:`nonlocal` deyiminde isimlendirilmedikçe), ancak bunlara " "referans verilebilir." #: tutorial/controlflow.rst:479 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " "are passed using *call by value* (where the *value* is always an object " "*reference*, not the value of the object). [#]_ When a function calls " "another function, or calls itself recursively, a new local symbol table is " "created for that call." msgstr "" "Bir fonksiyon çağrısının gerçek parametreleri (argümanları), çağrıldığında " "çağrılan fonksiyonun yerel sembol tablosunda tanıtılır; bu nedenle, " "argümanlar *call by value* (burada *value* her zaman bir nesne " "*referans*'dır, nesnenin değeri değildir) kullanılarak aktarılır. [#]_ Bir " "fonksiyon başka bir fonksiyonu çağırdığında veya kendini tekrarlı olarak " "çağırdığında, bu çağrı için yeni bir yerel sembol tablosu oluşturulur." #: tutorial/controlflow.rst:486 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " "to by that name as a user-defined function. Other names can also point to " "that same function object and can also be used to access the function::" msgstr "" "Bir fonksiyon tanımı, fonksiyon adını geçerli sembol tablosundaki fonksiyon " "nesnesiyle ilişkilendirir. Yorumlayıcı, bu adın işaret ettiği nesneyi " "kullanıcı tanımlı bir fonksiyon olarak tanır. Diğer isimler de aynı " "fonksiyon nesnesine işaret edebilir ve fonksiyona erişmek için " "kullanılabilir::" #: tutorial/controlflow.rst:497 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " "without a :keyword:`return` statement do return a value, albeit a rather " "boring one. This value is called ``None`` (it's a built-in name). Writing " "the value ``None`` is normally suppressed by the interpreter if it would be " "the only value written. You can see it if you really want to using :func:" "`print`::" msgstr "" "Diğer dillerden geliyorsanız, ``fib`` 'in bir fonksiyon değil, değer " "döndürmediği için bir prosedür olduğuna itiraz edebilirsiniz. Aslında, :" "keyword:`return` ifadesi olmayan fonksiyonlar bile, oldukça sıkıcı olsa da, " "bir değer döndürürler. Bu değer ``None`` olarak adlandırılır (yerleşik bir " "isimdir). Normalde ``None`` değerinin yazılması, yazılan tek değer olacaksa " "yorumlayıcı tarafından bastırılır. Eğer gerçekten istiyorsanız :func:`print` " "kullanarak görebilirsiniz::" #: tutorial/controlflow.rst:508 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" msgstr "" "Fibonacci serisindeki sayıların listesini döndürebilecek bir fonksiyon " "yazmak gayet basittir, onun yerine şunu yazdırarak::" #: tutorial/controlflow.rst:524 msgid "This example, as usual, demonstrates some new Python features:" msgstr "" "Bu örnek, her zamanki gibi, bazı yeni Python özelliklerini göstermektedir:" #: tutorial/controlflow.rst:526 msgid "" "The :keyword:`return` statement returns with a value from a function. :" "keyword:`!return` without an expression argument returns ``None``. Falling " "off the end of a function also returns ``None``." msgstr "" "Bir :keyword:`return` deyimi bir fonksiyondan bir değerle döner. :keyword:`!" "return` deyimi bir ifade argümanı olmadan ``None`` döndürür. Bir fonksiyonun " "sonundan düşmek de ``None`` değerini döndürür." #: tutorial/controlflow.rst:530 #, fuzzy msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " "``obj.methodname``, where ``obj`` is some object (this may be an " "expression), and ``methodname`` is the name of a method that is defined by " "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " "possible to define your own object types and methods, using *classes*, see :" "ref:`tut-classes`) The method :meth:`!append` shown in the example is " "defined for list objects; it adds a new element at the end of the list. In " "this example it is equivalent to ``result = result + [a]``, but more " "efficient." msgstr "" "``result.append(a)`` ifadesi ``result`` liste nesnesinin bir *metodunu* " "çağırır. Bir yöntem, bir nesneye 'ait' olan ve ``obj.methodname`` olarak " "adlandırılan bir işlevdir; burada ``obj`` bir nesnedir (bu bir ifade " "olabilir) ve ``methodname`` nesnenin türü tarafından tanımlanan bir yöntemin " "adıdır. Farklı türler farklı yöntemler tanımlar. Farklı türlerdeki " "yöntemler, belirsizliğe neden olmadan aynı ada sahip olabilir. (*classes* " "kullanarak kendi nesne türlerinizi ve yöntemlerinizi tanımlamak mümkündür, " "bkz :ref:`tut-classes`) Örnekte gösterilen :meth:`append` yöntemi liste " "nesneleri için tanımlanmıştır; listenin sonuna yeni bir öğe ekler. Bu " "örnekte ``result = result + [a]`` ile eş değerdir, ancak daha verimlidir." #: tutorial/controlflow.rst:545 msgid "More on Defining Functions" msgstr "İşlev Tanımlama hakkında daha fazla bilgi" #: tutorial/controlflow.rst:547 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "Değişken sayıda argüman içeren fonksiyonlar tanımlamak da mümkündür. " "Birleştirilebilen üç form vardır." #: tutorial/controlflow.rst:554 msgid "Default Argument Values" msgstr "Varsayılan Değişken Değerleri" #: tutorial/controlflow.rst:556 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " "than it is defined to allow. For example::" msgstr "" "En kullanışlı biçim, bir veya daha fazla bağımsız değişken için varsayılan " "bir değer belirtmektir. Bu, izin vermek üzere tanımlandığından daha az " "sayıda bağımsız değişkenle çağrılabilen bir fonksiyon oluşturur. Örneğin::" #: tutorial/controlflow.rst:572 msgid "This function can be called in several ways:" msgstr "Bu fonksiyon çeşitli yollarla çağrılabilir:" #: tutorial/controlflow.rst:574 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "" "sadece zorunlu argümanı vererek: ``ask_ok('Gerçekten çıkmak istiyor " "musun?')``" #: tutorial/controlflow.rst:576 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "" "isteğe bağlı değişkenlerden birini vermek: ``ask_ok('OK to overwrite the " "file?', 2)``" #: tutorial/controlflow.rst:578 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" msgstr "" "ya da bütün değişkenleri vermek: ``ask_ok('OK to overwrite the file?', 2, " "'Come on, only yes or no!')``" #: tutorial/controlflow.rst:581 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "" "Bu örnek ayrıca :keyword:`in` anahtar sözcüğünü de tanıtır. Bu, bir dizinin " "belirli bir değer içerip içermediğini test eder." #: tutorial/controlflow.rst:584 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" msgstr "" "Varsayılan değerler *tanımlayan* kapsamdaki fonksiyon tanımlama noktasında " "değerlendirilir, böylece ::" #: tutorial/controlflow.rst:595 msgid "will print ``5``." msgstr "``5`` çıktısını verecektir." #: tutorial/controlflow.rst:597 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " "dictionary, or instances of most classes. For example, the following " "function accumulates the arguments passed to it on subsequent calls::" msgstr "" "**Önemli uyarı:** Varsayılan değer yalnızca bir kez değerlendirilir. " "Varsayılan değer liste, sözlük veya çoğu sınıfın örnekleri gibi " "değiştirilebilir bir nesne olduğunda bu durum fark yaratır. Örneğin, " "aşağıdaki fonksiyon sonraki çağrılarda kendisine aktarılan argümanları " "biriktirir::" #: tutorial/controlflow.rst:610 msgid "This will print ::" msgstr "Bu şu çıktıyı verecektir ::" #: tutorial/controlflow.rst:616 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "" "Varsayılan değerin sonraki çağrılar arasında paylaşılmasını istemiyorsanız, " "bunun yerine fonksiyonu şu şekilde yazabilirsiniz::" #: tutorial/controlflow.rst:629 msgid "Keyword Arguments" msgstr "Anahtar Kelime Değişkenleri" #: tutorial/controlflow.rst:631 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " "function::" msgstr "" "Fonksiyonlar ayrıca ``kwarg=value`` şeklinde :term:`anahtar kelime " "argümanları ` kullanılarak da çağrılabilir. Örneğin, " "aşağıdaki fonksiyon::" #: tutorial/controlflow.rst:640 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " "of the following ways::" msgstr "" "bir gerekli argüman (``voltage``) ve üç isteğe bağlı argüman (``state``, " "``action`` ve ``type``) kabul eder. Bu fonksiyon aşağıdaki yollardan " "herhangi biriyle çağrılabilir::" #: tutorial/controlflow.rst:651 msgid "but all the following calls would be invalid::" msgstr "ancak aşağıdaki tüm çağrılar geçersiz olacaktır::" #: tutorial/controlflow.rst:658 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " "function (e.g. ``actor`` is not a valid argument for the ``parrot`` " "function), and their order is not important. This also includes non-" "optional arguments (e.g. ``parrot(voltage=1000)`` is valid too). No argument " "may receive a value more than once. Here's an example that fails due to this " "restriction::" msgstr "" "Bir fonksiyon çağrısında, anahtar kelime argümanları konumsal argümanları " "takip etmelidir. Aktarılan tüm anahtar sözcük argümanları fonksiyon " "tarafından kabul edilen argümanlardan biriyle eşleşmelidir (örneğin " "``actor`` ``parrot`` fonksiyonu için geçerli bir argüman değildir) ve " "sıraları önemli değildir. Buna isteğe bağlı olmayan argümanlar da dahildir " "(örneğin ``parrot(voltage=1000)`` da geçerlidir). Hiçbir argüman birden " "fazla değer alamaz. İşte bu kısıtlama nedeniyle başarısız olan bir örnek::" #: tutorial/controlflow.rst:674 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " "except for those corresponding to a formal parameter. This may be combined " "with a formal parameter of the form ``*name`` (described in the next " "subsection) which receives a :ref:`tuple ` containing the " "positional arguments beyond the formal parameter list. (``*name`` must " "occur before ``**name``.) For example, if we define a function like this::" msgstr "" "``**name`` biçiminde bir son biçimsel parametre mevcut olduğunda, biçimsel " "parametreye karşılık gelenler dışındaki tüm anahtar kelime argümanlarını " "içeren bir sözlük alır (bkz. :ref:`typesmapping`). Bu, biçimsel parametre :" "ref:`tuple ` listesinin ötesindeki konumsal argümanları içeren " "bir ``*name`` biçimindeki bir biçimsel parametre ile birleştirilebilir (bir " "sonraki alt bölümde açıklanmıştır). (``*name``, ``**name`` 'den önce " "gelmelidir.) Örneğin, aşağıdaki gibi bir fonksiyon tanımlarsak::" #: tutorial/controlflow.rst:691 msgid "It could be called like this::" msgstr "Şöyle denebilir::" #: tutorial/controlflow.rst:699 msgid "and of course it would print:" msgstr "ve tabii ki yazdıracaktır:" #: tutorial/controlflow.rst:712 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "" "Anahtar sözcük bağımsız değişkenlerinin yazdırılma sırasının, fonksiyon " "çağrısında sağlandıkları sırayla eşleşmesinin garanti edildiğini unutmayın." #: tutorial/controlflow.rst:716 msgid "Special parameters" msgstr "Özel parametreler" #: tutorial/controlflow.rst:718 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " "restrict the way arguments can be passed so that a developer need only look " "at the function definition to determine if items are passed by position, by " "position or keyword, or by keyword." msgstr "" "Varsayılan olarak, argümanlar bir Python fonksiyonuna ya pozisyona göre ya " "da açıkça anahtar kelimeye göre aktarılabilir. Okunabilirlik ve performans " "için, argümanların geçirilme şeklini kısıtlamak mantıklıdır, böylece bir " "geliştiricinin öğelerin konumla mı, konumla ya da anahtar sözcükle mi yoksa " "anahtar sözcükle mi geçirildiğini belirlemek için yalnızca fonksiyon " "tanımına bakması gerekir." #: tutorial/controlflow.rst:724 msgid "A function definition may look like:" msgstr "Bir fonksiyon tanımı aşağıdaki gibi görünebilir:" #: tutorial/controlflow.rst:735 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" "only, positional-or-keyword, and keyword-only. Keyword parameters are also " "referred to as named parameters." msgstr "" "burada ``/`` ve ``*`` isteğe bağlıdır. Kullanılırsa, bu semboller, " "argümanların fonksiyona nasıl geçirilebileceğine göre parametre türünü " "gösterir: yalnızca konumsal, konumsal veya anahtar sözcük ve yalnızca " "anahtar sözcük. Anahtar sözcük parametreleri, adlandırılmış parametreler " "olarak da adlandırılır." #: tutorial/controlflow.rst:742 msgid "Positional-or-Keyword Arguments" msgstr "Konumsal veya Anahtar Kelime Argümanları" #: tutorial/controlflow.rst:744 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "Eğer ``/`` ve ``*`` fonksiyon tanımında mevcut değilse, argümanlar bir " "fonksiyona pozisyon veya anahtar kelime ile aktarılabilir." #: tutorial/controlflow.rst:749 msgid "Positional-Only Parameters" msgstr "Yalnızca Konumsal Parametreler" #: tutorial/controlflow.rst:751 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " "matters, and the parameters cannot be passed by keyword. Positional-only " "parameters are placed before a ``/`` (forward-slash). The ``/`` is used to " "logically separate the positional-only parameters from the rest of the " "parameters. If there is no ``/`` in the function definition, there are no " "positional-only parameters." msgstr "" "Bu konuya biraz daha detaylı bakacak olursak, belirli parametreleri " "*positional-only* olarak işaretlemek mümkündür. Eğer *konumsal-sadece* ise, " "parametrelerin sırası önemlidir ve parametreler anahtar kelime ile " "aktarılamaz. Yalnızca konumsal parametreler bir ``/`` (ileri eğik çizgi) " "önüne yerleştirilir. ``/`` sadece konumsal parametreleri diğer " "parametrelerden mantıksal olarak ayırmak için kullanılır. Fonksiyon " "tanımında ``/`` yoksa, sadece konumsal parametre yoktur." #: tutorial/controlflow.rst:759 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "" "``/`` işaretini takip eden parametreler *konumsal veya anahtar sözcük* veya " "*sadece anahtar sözcük* olabilir." #: tutorial/controlflow.rst:763 msgid "Keyword-Only Arguments" msgstr "Yalnızca Anahtar Sözcük İçeren Değişkenler" #: tutorial/controlflow.rst:765 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " "the first *keyword-only* parameter." msgstr "" "Parametrelerin anahtar sözcük argümanıyla geçirilmesi gerektiğini belirterek " "parametreleri *anahtar sözcüğe özel* olarak işaretlemek için, argüman " "listesine ilk *anahtar sözcüğe özel* parametreden hemen önce bir ``*`` " "yerleştirin." #: tutorial/controlflow.rst:771 msgid "Function Examples" msgstr "Fonksiyon Örnekleri" #: tutorial/controlflow.rst:773 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" msgstr "" "``/`` ve ``*`` işaretlerine çok dikkat ederek aşağıdaki örnek fonksiyon " "tanımlarını göz önünde bulundurun::" #: tutorial/controlflow.rst:789 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " "by position or keyword::" msgstr "" "İlk fonksiyon tanımı, ``standard_arg``, en bilinen biçimdir, çağırma " "kuralına herhangi bir kısıtlama getirmez ve argümanlar konum veya anahtar " "kelime ile aktarılabilir::" #: tutorial/controlflow.rst:799 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" msgstr "" "İkinci fonksiyon ``pos_only_arg``, fonksiyon tanımında bir ``/`` olduğu için " "sadece konumsal parametreleri kullanacak şekilde sınırlandırılmıştır::" #: tutorial/controlflow.rst:810 msgid "" "The third function ``kwd_only_args`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" msgstr "" "Üçüncü fonksiyon ``kwd_only_args`` sadece fonksiyon tanımında ``*`` ile " "belirtilen anahtar kelime argümanlarına izin verir::" #: tutorial/controlflow.rst:821 msgid "" "And the last uses all three calling conventions in the same function " "definition::" msgstr "Sonuncusu ise aynı fonksiyon tanımında üç çağrı kuralını da kullanır::" #: tutorial/controlflow.rst:841 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " "as a key::" msgstr "" "Son olarak, ``name`` konumsal argümanı ile ``name`` anahtarına sahip " "``**kwds`` arasında potansiyel bir çakışma olan bu fonksiyon tanımını " "düşünün::" #: tutorial/controlflow.rst:846 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" msgstr "" "Anahtar kelime ``'name'`` her zaman ilk parametreye bağlanacağı için " "``True`` döndürmesini sağlayacak olası bir çağrı yoktur. Örneğin::" #: tutorial/controlflow.rst:855 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " "arguments::" msgstr "" "Ancak ``/`` (yalnızca konumsal argümanlar) kullanıldığında, ``name`` bir " "konumsal argüman olarak ve ``'name'`` anahtar kelime argümanlarında bir " "anahtar olarak izin verdiği için mümkündür::" #: tutorial/controlflow.rst:863 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "" "Başka bir deyişle, yalnızca konumsal parametrelerin adları ``**kwds`` içinde " "belirsizlik olmadan kullanılabilir." #: tutorial/controlflow.rst:868 msgid "Recap" msgstr "Özet" #: tutorial/controlflow.rst:870 msgid "" "The use case will determine which parameters to use in the function " "definition::" msgstr "" "Kullanım durumu, fonksiyon tanımında hangi parametrelerin kullanılacağını " "belirleyecektir::" #: tutorial/controlflow.rst:874 msgid "As guidance:" msgstr "Rehber olarak:" #: tutorial/controlflow.rst:876 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " "meaning, if you want to enforce the order of the arguments when the function " "is called or if you need to take some positional parameters and arbitrary " "keywords." msgstr "" "Parametrelerin adının kullanıcı tarafından kullanılamamasını istiyorsanız " "sadece pozisyonel seçeneğini kullanın. Bu, parametre adlarının gerçek bir " "anlamı olmadığında, fonksiyon çağrıldığında bağımsız değişkenlerin sırasını " "zorlamak istediğinizde veya bazı konumsal parametreler ve rastgele anahtar " "sözcükler almanız gerektiğinde kullanışlıdır." #: tutorial/controlflow.rst:881 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " "relying on the position of the argument being passed." msgstr "" "Adların bir anlamı olduğunda ve fonksiyon tanımının adlarla açık olmasıyla " "daha anlaşılır olduğunda veya kullanıcıların geçirilen argümanın konumuna " "güvenmesini önlemek istediğinizde yalnızca anahtar sözcük kullanın." #: tutorial/controlflow.rst:884 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." msgstr "" "Bir API için, parametrenin adı gelecekte değiştirilirse API " "değişikliklerinin bozulmasını önlemek için yalnızca konumsal kullanın." #: tutorial/controlflow.rst:890 msgid "Arbitrary Argument Lists" msgstr "Keyfi Argüman Listeleri" #: tutorial/controlflow.rst:895 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " "wrapped up in a tuple (see :ref:`tut-tuples`). Before the variable number " "of arguments, zero or more normal arguments may occur. ::" msgstr "" "Son olarak, en az kullanılan seçenek, bir fonksiyonun rastgele sayıda " "argümanla çağrılabileceğini belirtmektir. Bu argümanlar bir tuple içinde " "paketlenecektir (bkz :ref:`tut-tuples`). Değişken argüman sayısından önce, " "sıfır veya daha fazla normal argüman olabilir. ::" #: tutorial/controlflow.rst:904 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " "passed to the function. Any formal parameters which occur after the " "``*args`` parameter are 'keyword-only' arguments, meaning that they can only " "be used as keywords rather than positional arguments. ::" msgstr "" "Normalde *variadic* argümanlar biçimsel parametreler listesinde en sonda yer " "alır, çünkü fonksiyona aktarılan geri kalan tüm girdi argümanlarını " "toplarlar. ``*args`` parametresinden sonra gelen tüm biçimsel parametreler " "'keyword-only' (yalnızca-anahtar-kelime) argümanlarıdır, yani konumsal " "argümanlar yerine sadece anahtar kelimeler olarak kullanılabilirler. ::" #: tutorial/controlflow.rst:921 msgid "Unpacking Argument Lists" msgstr "Argüman Listelerini Açma" #: tutorial/controlflow.rst:923 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " "positional arguments. For instance, the built-in :func:`range` function " "expects separate *start* and *stop* arguments. If they are not available " "separately, write the function call with the ``*``\\ -operator to unpack " "the arguments out of a list or tuple::" msgstr "" "Tersi durum, argümanlar zaten bir liste veya tuple içinde olduğunda, ancak " "ayrı konumsal argümanlar gerektiren bir fonksiyon çağrısı için paketten " "çıkarılması gerektiğinde ortaya çıkar. Örneğin, yerleşik :func:`range` " "fonksiyonu ayrı *start* ve *stop* argümanları bekler. Eğer bunlar ayrı " "olarak mevcut değilse, argümanları bir listeden veya tuple'dan çıkarmak için " "fonksiyon çağrısını ``*``\\ -operatörü ile yazın::" #: tutorial/controlflow.rst:939 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" msgstr "" "Aynı şekilde, sözlükler ``**``\\ -operatörü ile anahtar sözcük argümanları " "sunabilir::" #: tutorial/controlflow.rst:955 msgid "Lambda Expressions" msgstr "Lambda İfadeleri" #: tutorial/controlflow.rst:957 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " "Lambda functions can be used wherever function objects are required. They " "are syntactically restricted to a single expression. Semantically, they are " "just syntactic sugar for a normal function definition. Like nested function " "definitions, lambda functions can reference variables from the containing " "scope::" msgstr "" "Küçük anonim fonksiyonlar :keyword:`lambda` anahtar sözcüğü ile " "oluşturulabilir. Bu fonksiyon iki argümanının toplamını döndürür: ``lambda " "a, b: a+b``. Lambda fonksiyonları, fonksiyon nesnelerinin gerekli olduğu her " "yerde kullanılabilir. Sözdizimsel olarak tek bir ifadeyle sınırlıdırlar. " "Anlamsal olarak, normal bir fonksiyon tanımı için sadece sözdizimsel " "şekerdirler. İç içe işlev tanımları gibi, lambda işlevleri de içeren " "kapsamdaki değişkenlere başvurabilir::" #: tutorial/controlflow.rst:974 msgid "" "The above example uses a lambda expression to return a function. Another " "use is to pass a small function as an argument::" msgstr "" "Yukarıdaki örnekte bir fonksiyon döndürmek için bir lambda ifadesi " "kullanılmıştır. Başka bir kullanım da küçük bir fonksiyonu argüman olarak " "geçirmektir::" #: tutorial/controlflow.rst:986 msgid "Documentation Strings" msgstr "Dokümantasyon Stringler'i" #: tutorial/controlflow.rst:993 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "" "Belge dizelerinin içeriği ve biçimlendirilmesiyle ilgili bazı kurallar " "aşağıda verilmiştir." #: tutorial/controlflow.rst:996 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " "type, since these are available by other means (except if the name happens " "to be a verb describing a function's operation). This line should begin " "with a capital letter and end with a period." msgstr "" "İlk satır her zaman nesnenin amacının kısa ve öz bir özeti olmalıdır. Öz " "olması için, nesnenin adı veya türü açıkça belirtilmemelidir, çünkü bunlar " "başka yollarla elde edilebilir (adın bir fonksiyonun çalışmasını açıklayan " "bir fiil olması durumu hariç). Bu satır büyük harfle başlamalı ve nokta ile " "bitmelidir." #: tutorial/controlflow.rst:1002 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " "The following lines should be one or more paragraphs describing the object's " "calling conventions, its side effects, etc." msgstr "" "Belgeleme string'inde daha fazla satır varsa, ikinci satır boş olmalı ve " "özeti açıklamanın geri kalanından görsel olarak ayırmalıdır. Sonraki " "satırlar, nesnenin çağrı kurallarını, yan etkilerini vb. açıklayan bir veya " "daha fazla paragraftan oluşmalıdır." #: tutorial/controlflow.rst:1007 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " "desired. This is done using the following convention. The first non-blank " "line *after* the first line of the string determines the amount of " "indentation for the entire documentation string. (We can't use the first " "line since it is generally adjacent to the string's opening quotes so its " "indentation is not apparent in the string literal.) Whitespace " "\"equivalent\" to this indentation is then stripped from the start of all " "lines of the string. Lines that are indented less should not occur, but if " "they occur all their leading whitespace should be stripped. Equivalence of " "whitespace should be tested after expansion of tabs (to 8 spaces, normally)." msgstr "" "Python ayrıştırıcısı, Python'daki çok satırlı dize değişmezlerinden " "girintiyi çıkarmaz, bu nedenle belgeleri işleyen araçların istenirse " "girintiyi çıkarması gerekir. Bu, aşağıdaki kural kullanılarak yapılır. " "Dizenin ilk satırından *sonraki* boş olmayan ilk satır, tüm dokümantasyon " "dizesi için girinti miktarını belirler. (İlk satırı kullanamayız, çünkü " "genellikle dizenin açılış tırnaklarına bitişiktir, bu nedenle girintisi dize " "değişmezinde belirgin değildir) Bu girintiye \"eş değer\" boşluk daha sonra " "dizenin tüm satırlarının başlangıcından çıkarılır. Daha az girintili " "satırlar oluşmamalıdır, ancak oluşurlarsa başlarındaki tüm boşluklar " "çıkarılmalıdır. Beyaz boşlukların eş değerliği sekmelerin " "genişletilmesinden sonra test edilmelidir (normalde 8 boşluğa kadar)." #: tutorial/controlflow.rst:1019 msgid "Here is an example of a multi-line docstring::" msgstr "İşte çok satırlı bir docstring örneği::" #: tutorial/controlflow.rst:1037 msgid "Function Annotations" msgstr "Fonksiyon Ek Açıklamaları" #: tutorial/controlflow.rst:1045 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " "and :pep:`484` for more information)." msgstr "" ":ref:`Fonksiyon ek açıklamaları ` kullanıcı tanımlı fonksiyonlar " "tarafından kullanılan tipler hakkında tamamen isteğe bağlı meta veri " "bilgileridir (daha fazla bilgi için :pep:`3107` ve :pep:`484` sayfalarına " "bakınız)." #: tutorial/controlflow.rst:1049 #, fuzzy msgid "" ":term:`Annotations ` are stored in the :attr:`!" "__annotations__` attribute of the function as a dictionary and have no " "effect on any other part of the function. Parameter annotations are defined " "by a colon after the parameter name, followed by an expression evaluating to " "the value of the annotation. Return annotations are defined by a literal ``-" ">``, followed by an expression, between the parameter list and the colon " "denoting the end of the :keyword:`def` statement. The following example has " "a required argument, an optional argument, and the return value annotated::" msgstr "" ":term:`İşaretlemeler `, fonksiyonun :attr:" "`__annotations__` özelliğinde bir sözlük olarak saklanır ve fonksiyonun " "diğer bölümleri üzerinde hiçbir etkisi yoktur. Parametre ek açıklamaları, " "parametre adından sonra iki nokta üst üste işareti ve ardından ek " "açıklamanın değerine göre değerlendirilen bir ifade ile tanımlanır. Dönüş " "ek açıklamaları, parametre listesi ile :keyword:`def` ifadesinin sonunu " "belirten iki nokta arasında bir ``->`` ifadesi ve ardından bir ifade ile " "tanımlanır. Aşağıdaki örnekte bir gerekli argüman, bir isteğe bağlı argüman " "ve dönüş değeri ek açıklamalıdır::" #: tutorial/controlflow.rst:1071 msgid "Intermezzo: Coding Style" msgstr "Intermezzo: Kodlama Stili" #: tutorial/controlflow.rst:1076 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " "more concise, *formatted*) in different styles; some are more readable than " "others. Making it easy for others to read your code is always a good idea, " "and adopting a nice coding style helps tremendously for that." msgstr "" "Artık daha uzun, daha karmaşık Python parçaları yazmak üzere olduğunuza " "göre, *kodlama stili* hakkında konuşmak için iyi bir zaman. Çoğu dil farklı " "stillerde yazılabilir (ya da daha özlü bir ifadeyle *biçimlendirilebilir*); " "bazıları diğerlerinden daha okunaklıdır. Başkalarının kodunuzu okumasını " "kolaylaştırmak her zaman iyi bir fikirdir ve güzel bir kodlama stili " "benimsemek buna çok yardımcı olur." #: tutorial/controlflow.rst:1082 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " "Python developer should read it at some point; here are the most important " "points extracted for you:" msgstr "" "Python için :pep:`8`, çoğu projenin bağlı olduğu stil kılavuzu olarak ortaya " "çıkmıştır; okunabilir ve göze hoş gelen bir kodlama stilini teşvik eder. " "Her Python geliştiricisi bir noktada onu okumalıdır; işte sizin için " "çıkarılan en önemli noktalar:" #: tutorial/controlflow.rst:1087 msgid "Use 4-space indentation, and no tabs." msgstr "4 aralıklı girinti kullanın ve sekme kullanmayın." #: tutorial/controlflow.rst:1089 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " "confusion, and are best left out." msgstr "" "4 boşluk, küçük girinti (daha fazla iç içe geçme derinliği sağlar) ve büyük " "girinti (okunması daha kolay) arasında iyi bir uzlaşmadır. Sekmeler " "karışıklığa neden olur ve en iyisi dışarıda bırakmaktır." #: tutorial/controlflow.rst:1093 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "Satırları 79 karakteri geçmeyecek şekilde sarın." #: tutorial/controlflow.rst:1095 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." msgstr "" "Bu, küçük ekranlı kullanıcılara yardımcı olur ve daha büyük ekranlarda " "birkaç kod dosyasının yan yana olmasını mümkün kılar." #: tutorial/controlflow.rst:1098 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "" "Fonksiyonları ve sınıfları ve fonksiyonların içindeki büyük kod bloklarını " "ayırmak için boş satırlar kullanın." #: tutorial/controlflow.rst:1101 msgid "When possible, put comments on a line of their own." msgstr "Mümkün olduğunda, yorumları kendi başlarına bir satıra koyun." #: tutorial/controlflow.rst:1103 msgid "Use docstrings." msgstr "Docstrings kullanın." #: tutorial/controlflow.rst:1105 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." msgstr "" "Operatörlerin etrafında ve virgüllerden sonra boşluk kullanın, ancak " "doğrudan parantez yapılarının içinde kullanmayın: ``a = f(1, 2) + g(3, 4)``." #: tutorial/controlflow.rst:1108 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " "functions and methods. Always use ``self`` as the name for the first method " "argument (see :ref:`tut-firstclasses` for more on classes and methods)." msgstr "" "Sınıflarınızı ve fonksiyonlarınızı tutarlı bir şekilde adlandırın; buradaki " "kural, sınıflar için ``UpperCamelCase``, fonksiyonlarını; metotlar için de " "``lowercase_with_underscores`` kullanmaktır. İlk yöntem argümanının adı " "olarak her zaman ``self`` kullanın (sınıflar ve yöntemler hakkında daha " "fazla bilgi için :ref:`tut-firstclasses` bölümüne bakın)." #: tutorial/controlflow.rst:1113 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " "case." msgstr "" "Kodunuz uluslararası ortamlarda kullanılacaksa süslü kodlamalar " "kullanmayın. Python'un varsayılanı, UTF-8 veya hatta düz ASCII her durumda " "en iyi sonucu verir." #: tutorial/controlflow.rst:1117 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " "the code." msgstr "" "Aynı şekilde, farklı bir dil konuşan kişilerin kodu okuması veya muhafaza " "etmesi için en ufak bir şans varsa, tanımlayıcılarda ASCII olmayan " "karakterler kullanmayın." #: tutorial/controlflow.rst:1123 msgid "Footnotes" msgstr "Dipnotlar" #: tutorial/controlflow.rst:1124 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " "to it (items inserted into a list)." msgstr "" "Aslında, *nesne referansı ile çağırma* daha iyi bir tanımlama olacaktır, " "çünkü değiştirilebilir bir nesne aktarılırsa, çağıran, çağırılanın üzerinde " "yaptığı tüm değişiklikleri (bir listeye eklenen öğeler) görecektir." #: tutorial/controlflow.rst:48 msgid "statement" msgstr "" #: tutorial/controlflow.rst:48 msgid "for" msgstr "" #: tutorial/controlflow.rst:988 #, fuzzy msgid "documentation strings" msgstr "Dokümantasyon Stringler'i" #: tutorial/controlflow.rst:988 #, fuzzy msgid "docstrings" msgstr "Docstrings kullanın." #: tutorial/controlflow.rst:988 msgid "strings, documentation" msgstr "" #: tutorial/controlflow.rst:892 msgid "* (asterisk)" msgstr "" #: tutorial/controlflow.rst:936 #, fuzzy msgid "in function calls" msgstr "Fonksiyon Örnekleri" #: tutorial/controlflow.rst:936 msgid "**" msgstr "" #: tutorial/controlflow.rst:1040 #, fuzzy msgid "function" msgstr "Fonksiyonların Tanımlanması" #: tutorial/controlflow.rst:1040 #, fuzzy msgid "annotations" msgstr "Fonksiyon Ek Açıklamaları" #: tutorial/controlflow.rst:1040 msgid "->" msgstr "" #: tutorial/controlflow.rst:1040 #, fuzzy msgid "function annotations" msgstr "Fonksiyon Ek Açıklamaları" #: tutorial/controlflow.rst:1040 msgid ": (colon)" msgstr "" #: tutorial/controlflow.rst:1074 msgid "coding" msgstr "" #: tutorial/controlflow.rst:1074 msgid "style" msgstr "" #~ msgid "" #~ "Loop statements may have an :keyword:`!else` clause; it is executed when " #~ "the loop terminates through exhaustion of the iterable (with :keyword:" #~ "`for`) or when the condition becomes false (with :keyword:`while`), but " #~ "not when the loop is terminated by a :keyword:`break` statement. This is " #~ "exemplified by the following loop, which searches for prime numbers::" #~ msgstr "" #~ "Döngü deyimleri bir :keyword:`!else` cümlesine sahip olabilir; bu cümle " #~ "döngü yinelenebilirin tükenmesiyle sonlandığında (:keyword:`for` ile) " #~ "veya koşul yanlış olduğunda (:keyword:`while` ile) çalıştırılır, ancak " #~ "döngü bir :keyword:`break` deyimiyle sonlandırıldığında çalıştırılmaz. " #~ "Bu, asal sayıları arayan aşağıdaki döngü ile örneklendirilmiştir::"